package com.thyme.system.controller;


import com.alibaba.fastjson.JSONObject;
import com.thyme.system.dao.WytShipmentDao;
import com.thyme.system.entity.WytShipment;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;


/**
 * @author renyifan
 * @date 2020/1/2 20:43
 */
@Controller
@RequestMapping("/shipment")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class ShipmentController {
    private final WytShipmentDao dao;

    @GetMapping("/user")
    public String index() {
        return "module/shipment/user";
    }

    @GetMapping("/detail")
    public String detail(String id, Model model) {
        WytShipment sysUser = dao.getById(id);
        model.addAttribute("sysUser", JSONObject.toJSONString(sysUser));
        return "module/shipment/detail";
    }
}
